package org.topdowntdd.sample.appfusemodularstruts.webapp.action.person;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.config.Result;

import org.topdowntdd.sample.appfusemodularstruts.manager.PersonManager;
import org.topdowntdd.sample.appfusemodularstruts.model.Person;

import com.opensymphony.xwork2.Action;

@Result( name=Action.SUCCESS, value = "/WEB-INF/pages/person/list.jsp" )
public class ListAction extends BaseAction {

	private List<Person> persons;

	public List<Person> getPersons() {
		return persons;
	}

	public void setPersonManager(PersonManager personManager) {
		this.personManager = personManager;
	}

	@Override
	public String execute() {
		persons = personManager.getAll();
		return SUCCESS;
	}

}